import BASE_URL from './env.js'

export const request = (options) =>{
	return new Promise((resolve, reject) => {
		const header = {
			'Content-Type': 'application/json',
		}
		uni.request({
			url:BASE_URL+'/api'+options.url,
			method: options.method,
			data: options.data,
			header: header,
			success(res) {
			   resolve(res.data)
			},
			fail: (err) => {
				reject(err)
			}
		})
	})
}